1. Field of the Invention
The present invention relates to an image processing method and apparatus and, more particularly, to an image processing method and apparatus, which can color-output a character, figure, raster image, and the like on the basis of print data, a command, and the like sent from a host computer.
2. Related Background Art
FIG. 1 shows a coordinate system serving as a reference for, e.g., coordinate points designated when a figure or character is drawn using a PDL (Page Description Language) or a page description command (this coordinate system will be referred to as a user coordinate system hereinafter).
A hatched rectangular portion in FIG. 1 indicates an effective print area (a possible draw area in a print sheet). As shown in FIG. 1, the length of the effective print area will be referred to as an effective print area height hereinafter, and the width will be referred to as an effective print area width hereinafter.
The coordinate system shown in FIG. 1 is a two-dimensional x-y orthogonal coordinate system, and has an origin at the lower left corner of the effective print area, as shown in FIG. 1.
The coordinate unit of this coordinate system can be desirably set (e.g., 0.01 mm, 1/72 inch, and the like).
Description elements of the PDL for figure drawing and page description commands, which are set based on the above-mentioned user coordinate system, are analyzed in an image processing apparatus in the order of reception, and are converted into information to be developed on a memory.
FIG. 2 shows a coordinate system serving as a reference for creating the above-mentioned memory development information (this coordinate system will be referred to as a printer coordinate system hereinafter).
The coordinate unit of this coordinate system is determined by the resolution of an image processing apparatus used (for example, when the resolution is 300 dpi, the coordinate unit is 1/300 inch).
A hatched rectangular portion in FIG. 2 is the same as the effective print area in FIG. 1.
This coordinate system is a two-dimensional x-y orthogonal coordinate system, and has an origin at the upper left corner of the effective print area.
FIG. 3 shows a memory map in an internal RAM area of a conventional image processing apparatus for performing color recording on the basis of the PDL or the page description command.
The RAM area is constituted by a system work memory, a vacant area, and page development memories (each corresponding to the size of the effective print area shown in FIG. 2) for Y (Yellow), M (Magenta), C (Cyan), and Bk (Black).
The system work memory is used as a storage area for information (variables, and the like) used in internal control of the image processing apparatus, a fixed work area, and the like.
The vacant area is used as an area for storing memory development information, a character cache memory, and the like.
FIG. 4 shows a paint color designation command of drawing attribute designation commands.
This command is used for designating a color for painting a portion inside a closed figure.
A command No. varies depending on drawing attribute designation, and is used for identifying command functions.
The content of a number-of-data parameter indicates the number of data following the number-of-data parameter.
For example, the content of a number-of-data parameter of a line color designation command is 4.
Y, M, C, and Bk values indicate density data values of Y (Yellow), M (Magenta), C (Cyan), and Bk (Black) as primary colors of coloring materials.
FIG. 5 shows an example of a polygon drawing command of drawing commands.
A command No. varies depending on drawing attribute designation, and is used for identifying command functions.
The content of a number-of-data parameter indicates the number of data following the number-of-data parameter.
Note that X and Y values of coordinates 1 to n are coordinates on the user coordinate system.
FIG. 6 shows an example of memory development information generated by analyzing the paint color designation command shown in FIG. 4.
A command table No. is used for identifying each memory development information.
The contents of other parameters are the same as those in FIG. 4.
FIG. 7 shows an example of memory development information generated by analyzing the polygon drawing command shown in FIG. 5.
A command table No. is used for identifying each memory development information.
The content of a number-of-data parameter indicates the number of data following the number-of-data parameter.
X1, Y1, . . . , Xn, and Yn are coordinates converted into those on the printer coordinate system on the basis of the resolution of the image processing apparatus.
FIG. 8 shows a case wherein drawing of a polygon defined by four coordinates (100, 200), (200, 200), (200, 100), and (100, 100) is set on the user coordinate system shown in FIG. 1 to have a coordinate unit of 1 mm.
FIG. 9 shows an example of a command issued when the polygon drawing shown in FIG. 8 is set.
FIG. 10 shows a case wherein polygon drawing on the user coordinate system shown in FIG. 8 is converted into polygon drawing on the printer coordinate system having a coordinate unit of 1/300 inch (about 1/11.8 mm).
As shown in FIG. 10, the effective print area height in this case is set to be 400 mm.
The four coordinates are (1,180, 2,360), (2,360, 2,360), (2,360, 3,540), and (1,180, 3,540).
FIG. 11 shows an example of memory development information of polygon drawing shown in FIG. 10, which information is generated by analyzing the polygon drawing command shown in FIG. 9.
FIG. 12 shows an example of memory development information set for paint color designation shown in FIG. 6.
In this case, each of Y, M, C, and Bk values ranges from 0 to 255. The Y value is set to be 255, and other values are set to be 0.
FIG. 13 shows an example of memory development information set for paint color designation shown in FIG. 6 in a monochrome mode.
In the monochrome mode, a gray scale process using the coloring material Bk is performed in place of a color process using Y, M, C, and Bk.
The gray scale density value ranges from 0 to 255. In this example, a value "51" indicates a density "20" [(51/255)%].
FIG. 14 shows a state wherein the polygon shown in FIG. 10 is divided using the coordinate unit of the printer coordinate system.
The minimum value of the Y-coordinate of this polygon is Y.sub.PMIN, and the maximum value of the Y-coordinate is Y.sub.PMAX.
In order to paint a portion inside this polygon, a paint pattern is developed on a development memory corresponding to a value between LEFTX and RIGHTX shown in FIG. 14.
FIG. 15 is a flow chart showing an example of a process for painting a portion inside the polygon shown in FIG. 14.
A drawing logic for the development memory of this example is "overwrite".
In step S300, it is checked if a color mode is selected.
If YES in step S300, the flow advances to step S301, and a paint process in the color mode is performed, thus ending the process.
If NO in step S300, the flow advances to step S302, and a paint process in the monochrome mode is performed, thus ending the process.
FIGS. 16 to 21 are flow charts showing a summary of the paint process in the color mode in step S301 in FIG. 15.
In step S310, memory development information for paint color designation shown in FIG. 6 is taken, and the flow advances to step S311.
In step S311, Y, M, C, and Bk values of paint colors are taken from the taken memory development information for paint color designation, and are respectively set in P_Y, P_M, P_C, and P_Bk. Thereafter, the flow advances to step S312.
In step S312, Y.sub.PMIN in FIG. 14 is set in .beta., and the flow advances to step S313.
In step S313, LEFTX and RIGHTX defining a range of X to be painted are computed, and the flow advances to step S314.
In step S314, addresses and bits on a Y-page memory in FIG. 3 corresponding to LEFTX and RIGHTX are computed, and the flow advances to step S315.
In step S315, the address and bit corresponding to LEFTX computed in step S314 are respectively set in Y.sub.LAD and Y.sub.LBIT, and the address and bit corresponding to RIGHTX are respectively set in Y.sub.RAD and Y.sub.RBIT. Thereafter, the flow advances to step S316.
In step S316, P_Y is compared with 0.
If it is determined in step S316 that P_Y=0, the flow advances to step S317, and a memory area (Y.sub.LAD, Y.sub.LBIT, Y.sub.RAD, Y.sub.RBIT) is cleared. The flow then advances to step S321.
If it is determined in step S316 that P_Y.noteq.0, the flow advances to step S318, and the storage address of a dither pattern corresponding to the value P_Y is taken. The flow then advances to step S319.
In step S319, the dither pattern is taken from the storage address, and the flow advances to step S320.
In step S320, the dither pattern taken in step S318 is developed on the memory area (Y.sub.LAD, Y.sub.LBIT, Y.sub.RAD, Y.sub.RBIT), and the flow advances to step S321.
In step S321, the addresses and bits on an M-page memory in FIG. 3 corresponding to LEFTX and RIGHTX are computed, and the flow advances to step S322.
In step S322, the address and bit corresponding to LEFTX computed in step S321 are respectively set in M.sub.LAD and M.sub.LBIT, and the address and bit corresponding to RIGHTX are respectively set in M.sub.RAD and M.sub.RBIT. Thereafter, the flow advances to step S323.
In step S323, P_M is compared with 0.
If it is determined in step S323 that P_M=0, the flow advances to step S324, and a memory area (M.sub.LAD, M.sub.LBIT, M.sub.RAD, M.sub.RBIT) is cleared. The flow then advances to step S328.
If it is determined in step S323 that P_M.noteq.0, the flow advances to step S325, and the storage address of a dither pattern corresponding to the value P_M is taken. Thereafter, the flow advances to step S326.
In step S326, the dither pattern is taken from the storage address, and the flow advances to step S327.
In step S327, the dither pattern taken in step S326 is developed on the memory area (M.sub.LAD, M.sub.LBIT, M.sub.RAD, M.sub.RBIT), and the flow advances to step S328.
In step S328, the addresses and bits on a C-page memory in FIG. 3 corresponding to LEFTX and RIGHTX are computed, and the flow advances to step S329.
In step S329, the address and bit corresponding to LEFTX computed in step S328 are respectively set in C.sub.LAD and C.sub.LBIT, and the address and bit corresponding to RIGHTX are respectively set in C.sub.RAD and C.sub.RBIT. Thereafter, the flow advances to step S330.
In step S330, P_C is compared with 0.
If it is determined in step S330 that P_C=0, the flow advances to step S331 to clear a memory area (C.sub.LAD, C.sub.LBIT, C.sub.RAD, C.sub.RBIT), and the flow advances to step S335.
If it is determined in step S330 that P_C.noteq.0, the flow advances to step S332 to take the storage address of a dither pattern corresponding to the value P_C, and the flow advances to step S333.
In step S333, the dither pattern is taken from the storage address, and the flow advances to step S334.
In step S334, the dither pattern taken in step S333 is developed on the memory area (C.sub.LAD, C.sub.LBIT, C.sub.RAD, C.sub.RBIT), and the flow advances to step S335.
In step S335, the addresses and bits on a Bk-page memory in FIG. 3 corresponding to LEFTX and RIGHTX are computed, and the flow advances to step S336.
In step S336, the address and bit corresponding to LEFTX computed in step S335 are respectively set in K.sub.LAD and K.sub.LBIT, and the address and bit corresponding to RIGHTX are respectively set in K.sub.RAD and K.sub.RBIT. The flow then advances to step S337.
In step S337, P_Bk is compared with 0.
If it is determined in step S337 that P_Bk=0, the flow advances to step S338 to clear a memory area (K.sub.LAD, K.sub.LBIT, K.sub.RAD, K.sub.RBIT), and the flow advances to step S342.
If it is determined in step S337 that P_Bk.noteq.0, the flow advances to step S339 to take the storage address of a dither pattern corresponding to the value P_Bk, and the flow advances to step S340.
In step S340, the dither pattern is taken from the storage address, and the flow advances to step S341.
In step S341, the dither pattern taken in step S340 is developed on the memory area (K.sub.LAD, K.sub.LBIT, K.sub.RAD, K.sub.RBIT), and the flow advances to step S342.
In step S342, it is checked if .beta.=Y.sub.PMAX, in FIG. 14.
If it is determined in step S342 that .beta.=Y.sub.PMAX, the process is ended.
If it is determined in step S342 that .beta..noteq.Y.sub.PMAX, the flow advances to step S343 to increment .beta. by one, and the flow returns to step S313.
FIGS. 22 and 23 are flow charts showing a summary of the paint process in the monochrome mode in step S302 in FIG. 15.
In step S350, memory development information for paint color designation shown in FIG. 13 is taken, and the flow advances to step S351.
In step S351, a gray scale density value of a paint color is taken from the taken memory development information for paint color designation, and is set in P_G. The flow then advances to step S352.
In step S352, .beta. is set in Y.sub.PMIN in FIG. 14, and the flow advances to step S353.
In step S353, the storage address of a dither pattern corresponding to the value P_G is taken, and the flow advances to step S354.
In step S354, the dither pattern is taken from the storage address, and the flow advances to step S355.
In step S355, LEFTX and RIGHTX as a range of X to be painted are computed, and the flow advances to step S356.
In step S356, the addresses and bits on the Bk-page memory in FIG. 3 corresponding to LEFTX and RIGHTX are computed, and the flow advances to step S357.
In step S357, the address and bit corresponding to LEFTX computed in step S356 are respectively set in K.sub.LAD and K.sub.LBIT, and the address and bit corresponding to RIGHTX are respectively set in K.sub.RAD and K.sub.RBIT. The flow then advances to step S358.
In step S358, the dither pattern taken in step S354 is developed on a memory area (K.sub.LAD, K.sub.LBIT, K.sub.RAD, K.sub.RBIT), and the flow advances to step S359.
In step S359, it is checked if .beta.=Y.sub.MAX in FIG. 14.
If it is determined in step S359 that .beta.=Y.sub.PMAX, the processing is ended.
If it is determined in step S359 that .beta..noteq.Y.sub.PMAX, the flow advances to step S360 to increment .beta. by one, and the flow returns to step S353.
As described above, in the control of the conventional image processing apparatus for performing color recording on the basis of the PDL or page description commands, a drawing pattern of each of Y (Yellow), M (Magenta), C (Cyan), and Bk (Black) as coloring materials of toners or inks is developed based on memory development information obtained by analyzing commands on a development memory having a size corresponding to the effective print area of a print sheet.
A portion inside the polygon shown in FIG. 14 is painted by the processes shown in FIGS. 15 to 23.
However, the prior art suffers from the following drawbacks.
(1) In the paint process for each scan line, each of the Y, M, C, and Bk density values is detected, and the paint process of a figure drawing on each of the Y-, M-, C-, and Bk-page memories is controlled based on the detected value, resulting in a long drawing time.
(2) In the paint process for each scan line, each of Y, M, C, and Bk dither patterns corresponding to the Y, M, C, and Bk density values is taken from the storage area, and the paint process of a figure drawing on each page memory is controlled, resulting in a long drawing time.
(3) Since paint processes of figure drawings with different drawing logics are performed in units of drawing logics, the program amount or hardware scale necessary for control increases as the number of types of corresponding drawing logics is increased.
(4) When the color mode and the monochrome mode (a mode for outputting color data as gray scale data) can be switched, paint processes of figure drawings are performed in units of modes, and the program amount or hardware scale necessary for control increases.